home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / VVM.CMD < prev    next >
Encoding:
Text File  |  1996-03-01  |  2.1 KB  |  126 lines

  1. #    Login.cmd for VVM Internet Services inc.
  2. #
  3. # This script will ask the user for their Username and Password each time
  4. #trace on
  5. #
  6. # set up some strings for dialling up
  7. #
  8. if ![load $number]
  9.   if [query $number "Enter your dial up phone number"]
  10.     save $number
  11.   end
  12. end
  13.  
  14.   if [username "Enter your login username"]
  15.     save $username
  16.   end
  17.  
  18.   if [password "Enter your login password"]
  19.     save $password
  20.   end
  21.  
  22. if ![load $modemsetup]
  23.   if [query $modemsetup "Enter your dial up phone number"]
  24.     save $modemsetup
  25.   end
  26. end
  27.  
  28.  
  29. #$modemsetup = "&F1"
  30. $prompt = ">"
  31. $userprompt = "sername:"
  32. $passprompt = "assword:"
  33. $slipcmd = "slip default"
  34. $addrtarg = "Your IP address is"
  35. $pppcmd = "ppp default"
  36.  
  37. %attempts = 999
  38. #
  39. #
  40. #----------------------------------------------------------
  41. #
  42. # initialize modem
  43. #
  44. output "atz"\13
  45. if ! [input 10 OK\n]
  46.   display "Modem is not responding"\n
  47.   abort
  48. end
  49. #
  50. # setup our modem commands
  51. #
  52. output "at"$modemsetup\13
  53. input 10 OK\n
  54. #
  55. # send phone number
  56. #
  57. %n = 0
  58. repeat
  59.   if %n = %attempts
  60.     display "Too many dial attempts"\n
  61.     abort
  62.   en
  63. d
  64.   output "atdt"$number\13
  65.   %ok = [input 30 CONNECT]
  66.   %n = %n + 1
  67. until %ok
  68. input 10 \n
  69. #
  70. #  wait till it's safe to send because some modem's hang up
  71. #  if you transmit during the connection phase
  72. #
  73. #wait 30 dcd
  74. #
  75. # now prod the terminal server
  76. #
  77. output \13
  78. #
  79. #  wait for the username prompt
  80. #
  81. input 30 $userprompt
  82. output $username\13
  83. #
  84. # and the password
  85. #
  86. input 30 $passprompt
  87. output $password\13
  88. #
  89. # we are now logged in
  90. #
  91. input 30 $prompt
  92. if %ppp
  93.   #
  94.   # jump into ppp mode
  95.   #
  96.   output $pppcmd\13
  97.   #
  98.   #input 30 "ssword:"\n
  99.   #
  100.   #output $ppppasswd\13
  101.   #
  102.   display "PPP mode selected.  Will try to negotiate IP address."\n
  103.   #
  104. else
  105.   #
  106.   # jump into slip mode
  107.   #
  108.   output $slipcmd\13
  109.   #
  110.   # wait for the address string
  111.   #
  112.   input 30 $addrtarg
  113.   #
  114.   # parse address
  115.   #
  116.   address 30
  117.   input 30 \n
  118.   #
  119.   # we are now connected, logged in and in slip mode.
  120.   #
  121.   display \n
  122.   display Connected.  Your IP address is \i.\n
  123. end
  124. #
  125. # now we are finished.
  126. #